<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
<head>
<title>平台用户日志</title>
<jsp:include page="../../../views/layout/inc.jsp"></jsp:include>

<script type="text/javascript">
	var dataGrid;
	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			singleSelect : true,
			url : '/accountLogController/dataGrid',
			fit : true,
			fitColumns : false,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : 10,
			pageList : [ 10, 20, 30, 40, 50 ],
			sortName : 'gmtCreate',
			sortOrder : 'desc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : true,
			frozenColumns : [ [ {
				field : 'accountLoginName',
				title : '用户名',
				width : 150,
				sortable : true
			},{
				field : 'accountName',
				title : '用户姓名',
				width : 100,
				sortable : true
			},{
				field : 'typeName',
				title : '日志类型',
				width : 100,
				sortable : true
			} ] ],
			columns : [ [ {
				field : 'content',
				title : '日志信息',
				width : 500
			}, {
				field : 'gmtCreate',
				title : '创建时间',
				width : 150,
				sortable : true,
				formatter:function(val,rec){ 
					 var unixTimestamp = new Date(val);  
                     return unixTimestamp.format("yyyy-MM-dd hh:mm:ss");  
				}
			}] ],
			toolbar : '#toolbar',
			onLoadSuccess : function() {
				$('#searchForm table').show();
				parent.$.messager.progress('close');
				$(this).datagrid('tooltip');
			}
		});
		
		$('#typeId').combobox({
			url : '/accountLogController/typeCombobox',
			width : 120,
		    panelHeight:'auto',
		    icons : [{
				iconCls : 'icon-clear',
				handler : function(e){
					$(e.data.target).combobox('setValue','');
				}
			}]
		}); 
	});

	
	

	function searchFun() {
		dataGrid.datagrid('load', $.serializeObject($('#searchForm')));
	}
	function cleanFun() {
		$('#searchForm input').val('');
		dataGrid.datagrid('load', {});
	}
</script>
</head>
<body>
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',title:'查询条件',border:false" style="height: 140px; overflow: hidden;">
			<form id="searchForm">
				<table class="table table-hover table-condensed" style="display: none;">
					<tr>
						<th>姓名</th>
						<td><input name="accountName" placeholder="可以模糊查询" class="span2" /></td>
					</tr>
					<tr>
						<th>日志类型</th>
						<td><input id="typeId" name="typeId" class="span2" /></td>
					</tr>
					<tr>
						<th>日志信息</th>
						<td><input name="content" placeholder="可以模糊查询" class="span2" /></td>
					</tr>
					<tr>
						<th>创建时间</th>
						<td><input name="startGmtCreate" id="startGmtCreate" placeholder="点击选择时间" class="Wdate" style="width:150px" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'endGmtCreate\') || \'%y-%M-%d\'}'})"/>
							至<input name="endGmtCreate" id="endGmtCreate" placeholder="点击选择时间" class="Wdate" style="width:150px" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'startGmtCreate\') || \'%y-%M-%d\'}'})"/></td>
					</tr>
				</table>
			</form>
		</div>
		<div data-options="region:'center',border:false">
			<table id="dataGrid"></table>
		</div>
	</div>
	<div id="toolbar" style="display: none;">
		<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="searchFun();">提交查询</a>
		<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="cleanFun();">重置查询</a>
	</div>
</body>
</html>